import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs";
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/apartment"

//院系信息api
const apiClassInfo = {
    //列表
    FindAllClass: function (collegeId, majorId, pageIndex, pageSize, searchValue, year) {
        const data = {
            collegeId, majorId, pageIndex, pageSize, searchValue, year
        }

        return request({
            url: baseUrl + '/manageClass/findAllClass',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //列表
    List: function (search, fields, order, page) {
        const data = {
            search,
            fields,
            order,
            page
        }
        return request({
            url: baseUrl + '/manageClass/list',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //列表
    NewClassList: function (search, page, fields, order,) {
        const data = {
            search, page, fields, order,
        }
        return request({
            url: baseUrl + '/manageClass/newClassList',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //年级列表
    GradeList: function (majorId) {
        const data = {
            majorId
        }
        return request({
            url: baseUrl + '/manageClass/gradeList',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //提取信息
    Get: function (id) {
        const data = {
            id
        }
        return request({
            url: baseUrl + '/manageClass/get',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //编辑
    Save: function (data) {
        const config = {
            headers: { 'Content-Type': 'application/json;charset=utf-8' },
        }
        return request.post(baseUrl + '/manageClass/save', data, config)
    },
    //删除
    Del: function (ids) {
        const data = {
            ids
        }
        return request({
            url: baseUrl + '/manageClass/delete',
            method: 'post',
            data: qs.stringify(data)
        })
    },

}
export { apiClassInfo }
